約 5,163,552 件
https://w.atwiki.jp/domaindrivendesign/pages/21.html
Ⅱ The Building Block of a Model-Driven Design P64 Wirfs-Brock は「オブジェクトデザイン」の著者。(読んでないけど) -- sinozaki (2009-10-13 21 56 09) P65 『MODEL-DRIVEN DESIGN』と『SMART UI』の「mutually exclusive choices」は「相関しあわない関係」位の意味? -- sinozaki (2009-10-13 22 15 23) P65 『AGGREGATES』と『FACTTORIES』の「encapsulate with」は読めばわかるのかな? -- sinozaki (2009-10-13 22 16 59) P64 Larmanは「実践UML」 -- 狩野 (2009-10-20 20 59 39) [memo]"Developing a good domain model is an art.” 態度がいさぎよくてよい。 -- kentaro714 (2009-10-21 12 22 05) しかし、より細かい要素はシステマティックになり得る。自分の認識とほぼ同じ。ソフトウェア科学の出番はこのあたりに大いにある。 -- kentaro714 (2009-10-21 12 24 00) 名前 コメント Chapter 4 Isolating the Domain P67 Domain-driven point of viewが次から展開されるという理解でいいのかな -- 狩野 (2009-10-21 16 22 03) 名前 コメント LAYERED ARCHITECTURE P70 本書ではないが、JavaEE勉強会のサイトではApplication Layerについて「ビジネスルールや知識を含まない。」と記載があるが、言い過ぎでありませんか?(英語力が拙く申し訳ない...) -- sinozaki (2009-10-13 22 54 16) P70 Infrastructure layer はUI widgets の Drawingにも使用。 -- sinozaki (2009-10-13 23 00 40) P70 下部3行の The domain object...で始まる文の文意がとれず。ここで言う The domain object はDomain Layer に属するものと取ってよいのか -- sinozaki (2009-10-14 00 20 50) P72 (機械翻訳)それ自体、穏やかに、そのドメインを隔離しないという問題を例証します。 要求からトランザクションコントロールまでのすべてが含まれなければならなかったので、ドメイン層は総合的な相互作用を続くほど簡単に保つためにレベルを下げられなければなりませんでした。 私たちが孤立しているドメイン層のデザインに焦点を合わせられるなら、そのドメインの規則をよりよく表したモデルのためにページの上と、そして、頭にスペースを持っているでしょうに、おそらく、原簿かクレジットと借り方オブジェクトか、金融取引オブジェクトを含んでいます。 -- sinozaki (2009-10-14 00 56 23) P68 上向き矢印は「some indirect mechanism」(observerの通知的な) -- 狩野 (2009-10-21 16 39 37) P70 下部3行は「ドメインオブジェクトはドメインモデルを表現することに注力できる、~から解放されることによって」という感じかな -- 狩野 (2009-10-21 16 53 32) P71 Example セキュリティ省いていいんかいなと。 -- 狩野 (2009-10-21 16 58 28) P72最上部 ここすごく意味がとりづらい。これは、説明のためにシンプルにしすぎたのが問題だと思ったのだが、これがdomainを隔離していないことになっているのか? -- kentaro714 (2009-10-21 17 12 41) P72 ... with design dependencies in only one direction. 依存関係の話がどこかでありましたが、これですね -- 村井 (2009-11-04 12 21 45) P72 the domain layer had to be dumbed down(やさしく書く直す)だから、隔離していないと読みました -- 狩野 (2009-11-04 15 05 49) 名前 コメント Relating the Layers P74 2行目の「Some technical components」が指しているものはなにか? -- sinozaki (2009-10-14 01 35 21) 直下の"to directly support the basic functions of other layers"なものや、"provide the mechanisms for them to relate"なものですね。丸括弧内に書いてあるのが、さらなる具体例です。 -- kentaro714 (2009-10-21 17 23 39) P73 main benefitは Versatilityではなく simplify, narrowly focused on its jobですね。 -- 村井 (2009-11-04 12 24 19) p72 パターンのmotivationはlayerのbenefitを失わずにconnectすることだ、というのはなるほどなるほど。 -- 狩野 (2009-11-04 15 13 34) P74 最初の段落解説希望 -- 狩野 (2009-11-04 15 22 11) 名前 コメント Architectural Frameworks 何気に結構重要な話では。プロジェクトでは理由と制約が逆になってます。 -- sinozaki (2009-10-14 01 51 14) すごく重要だと思う。特に、1段落目のラストとP74の一番下。 -- kentaro714 (2009-10-21 17 24 59) P74 下から4行目 generic Java objectsとは今でいうPOJOと思われ。Genericsではないよね -- 村井 (2009-11-04 12 27 41) P74 フレームワークに使われるなよ! -- 狩野 (2009-11-04 15 34 21) 名前 コメント The Domain Layer Is Where the Model Lives 名前 コメント THE SMART UI "ANTI-PATTERN" P77 Advantages の一行目 Productivity が高いことだけに惑わされない事を強調したい。 -- sinozaki (2009-10-14 21 40 48) P77 Advantages の最後行、「変更の影響が局所化されているからすばやくredoできる」っていうのは本当ですか? -- sinozaki (2009-10-14 21 49 31) ただ、個人的にはクラサバの時代と比べると"SMART UI"に相当するものは減ったと思っています。 -- sinozaki (2009-10-14 22 10 09) redo portionsてのはコピペみたいなものでは?ビジネスロジックが各UIにlocalizedly実装されているので、side-effectの面ではある意味メンテしやすいという考え方もありますし sinozaki -- 村井 (2009-11-04 12 30 49) [Memo]P76上段 "Many software projects do take and should continue to take a much less sophisticated design approach that I call the SMART UI." 多くのプロジェクトでは、SMART UIの方が良い、と言っている点に注意。 -- kentaro714 (2009-11-04 14 46 54) portions they can t figure out, つまり、よくわかんなくなったところを元に戻せる、ってことですよね。ドメイン層のオブジェクトが共用されている場合は、他の機能に影響があるので、テストなしでは進むのも戻るのも難しそう。 -- kentaro714 (2009-11-04 14 51 34) @shinozaki P79によると、Transaction ScriptはSmart UIやLayered Architecture(≒DDD)と異なる解決策としてあげられているので、そういう意味では減っているかと思います。 -- kentaro714 (2009-11-04 14 54 34) p76 unsophisticated team で complex project なんですがどうすればいいですか -- 狩野 (2009-11-04 15 52 41) 名前 コメント Other Kinds of Isolation 想定問答でしょうが、結果的にはずいぶん先への導入になっているだけですね。 -- kentaro714 (2009-11-04 14 56 15) 名前 コメント
https://w.atwiki.jp/lookworld/pages/59.html
■ホスト名称の確認 /etc/hosts 例)192.xx.xx.1 hhh.xxx.co.jp hhh 127.0.0.1 localhost.localdomain localhost ■ネットワーク設定の確認 /etc/sysconfig/network 例)NETWORKING=yes HOSTNAME=hhh ■IPアドレスの確認 /etc/sysconfig/network-scripts/ifcfg-eth0 例)DEVICE=eth0← ネットワーク・インタフェース名 BOOTPROTO=none← 固定IPアドレスの場合の指定 手動でIPアドレスを指定する時は、"static" BROADCAST=10.20.xx.255← ブロードキャスト・アドレス HWADDR=00 01 02 xx xx C8← MACアドレス IPADDR=10.20.xx.xx← IPアドレス NETMASK=255.255.255.0← ネット・マスク NETWORK=10.20.xx.0← ネットワーク・アドレス ONBOOT=yes← マシン起動時にネットワークを有効にする場合はyes TYPE=Ethernet GATEWAY=10.20.xx.254← ゲットウェイ USERCTL=no IPV6INIT=no PEERDNS=yes ■DNSサーバのIPアドレスをの確認 /etc/resolv.conf domain xxx.xxx.co.jp ■telnetを有効にする /etc/xinetd.d/krb5-telnet # default off # description The kerberized telnet server accepts normal telnet sessions, \ # but can also use Kerberos 5 authentication. service telnet { flags = REUSE socket_type = stream wait = no user = root server = /usr/kerberos/sbin/telnetd log_on_failure += USERID disable = yes← 初期値としては、"yes" } disable = yes を no に変更 変更したxinetdの設定ファイルを反映させるため、再起動 $ su - ・・・ root権限で接続 # /etc/rc.d/init.d/xinetd restart ■FTPの自動起動を有効にする # /sbin/chkconfig vsftpd on ■FTPの設定 vi /etc/vsftpd/vsftpd.conf anonymous_enable=NO ←YES を NO に変更→ Anonymousユーザ(匿名ユーザ)によるアクセスを許可するかの指定。 ascii_upload_enable=YES ←# を削除→ Asciiモードによる、アップロード/ダウンロードを許可するかを指定。 ascii_download_enable=YES ←# を削除→ Asciiモードによる、アップロード/ダウンロードを許可するかを指定。 : userlist_deny=NO ←追加→ /etc/vsftpd.user_list にて指定されたユーザのアクセスを許可するかを指定。 use_localtime=YES ←追加→ 日本標準時間を使うかどうかを指定。デフォルトはGMTによる表示。 vi /etc/vsftpd.user_list 特定ユーザしかFTPを使用できなくするユーザアクセス制限のために、デフォルト値の先頭に # を追記し、すべてコメントアウト #root #bin #daemon #adm #lp #sync #shutdown #halt #mail #news #uucp #operator #games #nobody FTPログインを許可するユーザを追加 ftp_user_name ■FTPの再起動 # /sbin/service vsftpd start ■Sendmailの設定 1./etc/mail/sendmail.mc を編集する 以下のファイルを編集する。 ※編集する前にsendmail.mcとsendmail.cfのオリジナルをコピーしておくことをお勧めします。 [root@Ee-Cash ~]# cp -p /etc/mail/sendmail.mc /etc/mail/sendmail.mc.org [root@Ee-Cash ~]# vi /etc/mail/sendmail.mc ①22行目あたりに、下記のような「SMART_HOST」という記述があると思うので、これを変更します。 (変更前)dnl define(`SMART_HOST ,`smtp.your.provider ) ↓ (変更後) define(`SMART_HOST ,`smtp [10.20.XX.XX] )dnl ②100行目あたりに、下記のような「EXPOSED_USER」という記述があると思うので、これの下に下記を追加します。 (変更前)EXPOSED_USER(`root )dnl ↓ (変更後)EXPOSED_USER(`root )dnl FEATURE(`nocanonify )dnl ③105行目あたりに、下記のような「DAEMON_OPTIONS(`Port=smtp)」という記述があると思うので、これをコメント(dnlを挿入)します。 (変更前)DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA )dnl ↓ (変更後)dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA )dnl ================================================================================ $ more sendmail.mc divert(-1)dnl dnl # dnl # This is the sendmail macro config file for m4. If you make changes to dnl # /etc/mail/sendmail.mc, you will need to regenerate the dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is dnl # installed and then performing a dnl # dnl # make -C /etc/mail dnl # include(`/usr/share/sendmail-cf/m4/cf.m4 )dnl VERSIONID(`setup for Red Hat Linux )dnl OSTYPE(`linux )dnl dnl # dnl # default logging level is 9, you might want to set it higher to dnl # debug the configuration dnl # dnl define(`confLOG_LEVEL , `9 )dnl dnl # dnl # Uncomment and edit the following line if your outgoing mail needs to dnl # be sent out through an external mail server dnl # dnl define(`SMART_HOST ,`smtp.your.provider ) define(`SMART_HOST ,`smtp [10.20.88.1] )dnl dnl # define(`confDEF_USER_ID ,``8 12 )dnl dnl define(`confAUTO_REBUILD )dnl define(`confTO_CONNECT , `1m )dnl define(`confTRY_NULL_MX_LIST ,true)dnl define(`confDONT_PROBE_INTERFACES ,true)dnl define(`PROCMAIL_MAILER_PATH ,`/usr/bin/procmail )dnl define(`ALIAS_FILE , `/etc/aliases )dnl define(`STATUS_FILE , `/var/log/mail/statistics )dnl define(`UUCP_MAILER_MAX , `2000000 )dnl define(`confUSERDB_SPEC , `/etc/mail/userdb.db )dnl define(`confPRIVACY_FLAGS , `authwarnings,novrfy,noexpn,restrictqrun )dnl define(`confAUTH_OPTIONS , `A )dnl dnl # dnl # The following allows relaying if the user authenticates, and disallows dnl # plaintext authentication (PLAIN/LOGIN) on non-TLS links dnl # dnl define(`confAUTH_OPTIONS , `A p )dnl dnl # dnl # PLAIN is the preferred plaintext authentication method and used by dnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do dnl # use LOGIN. Other mechanisms should be used if the connection is not dnl # guaranteed secure. dnl # Please remember that saslauthd needs to be running for AUTH. dnl # dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN )dnl dnl define(`confAUTH_MECHANISMS , `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN )dnl dnl # dnl # Rudimentary information on creating certificates for sendmail TLS dnl # cd /usr/share/ssl/certs; make sendmail.pem dnl # Complete usage dnl # make -C /usr/share/ssl/certs usage dnl # dnl define(`confCACERT_PATH ,`/usr/share/ssl/certs ) dnl define(`confCACERT ,`/usr/share/ssl/certs/ca-bundle.crt ) dnl define(`confSERVER_CERT ,`/usr/share/ssl/certs/sendmail.pem ) dnl define(`confSERVER_KEY ,`/usr/share/ssl/certs/sendmail.pem ) dnl # dnl # This allows sendmail to use a keyfile that is shared with OpenLDAP s dnl # slapd, which requires the file to be readble by group ldap dnl # dnl define(`confDONT_BLAME_SENDMAIL ,`groupreadablekeyfile )dnl dnl # dnl define(`confTO_QUEUEWARN , `4h )dnl dnl define(`confTO_QUEUERETURN , `5d )dnl dnl define(`confQUEUE_LA , `12 )dnl dnl define(`confREFUSE_LA , `18 )dnl define(`confTO_IDENT , `0 )dnl dnl FEATURE(delay_checks)dnl FEATURE(`no_default_msa ,`dnl )dnl FEATURE(`smrsh ,`/usr/sbin/smrsh )dnl FEATURE(`mailertable ,`hash -o /etc/mail/mailertable.db )dnl FEATURE(`virtusertable ,`hash -o /etc/mail/virtusertable.db )dnl FEATURE(redirect)dnl FEATURE(always_add_domain)dnl FEATURE(use_cw_file)dnl FEATURE(use_ct_file)dnl dnl # dnl # The following limits the number of processes sendmail can fork to accept dnl # incoming messages or process its message queues to 12.) sendmail refuses dnl # to accept connections once it has reached its quota of child processes. dnl # dnl define(`confMAX_DAEMON_CHILDREN , 12)dnl dnl # dnl # Limits the number of new connections per second. This caps the overhead dnl # incurred due to forking new sendmail processes. May be useful against dnl # DoS attacks or barrages of spam. (As mentioned below, a per-IP address dnl # limit would be useful but is not available as an option at this writing.) dnl # dnl define(`confCONNECTION_RATE_THROTTLE , 3)dnl dnl # dnl # The -t option will retry delivery if e.g. the user runs over his quota. dnl # FEATURE(local_procmail,` ,`procmail -t -Y -a $h -d $u )dnl FEATURE(`access_db ,`hash -T -o /etc/mail/access.db )dnl FEATURE(`blacklist_recipients )dnl EXPOSED_USER(`root )dnl FEATURE(`nocanonify )dnl dnl # dnl # The following causes sendmail to only listen on the IPv4 loopback address dnl # 127.0.0.1 and not on any other network devices. Remove the loopback dnl # address restriction to accept email from the internet or intranet. dnl # dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA )dnl dnl # dnl # The following causes sendmail to additionally listen to port 587 for dnl # mail from MUAs that authenticate. Roaming users who can t reach their dnl # preferred sendmail daemon due to port 25 being blocked or redirected find dnl # this useful. dnl # dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea )dnl dnl # dnl # The following causes sendmail to additionally listen to port 465, but dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can t dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS dnl # and doesn t support the deprecated smtps; Evolution 1.1.1 uses smtps dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1. dnl # dnl # For this to work your OpenSSL certificates must be configured. dnl # dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s )dnl dnl # dnl # The following causes sendmail to additionally listen on the IPv6 loopback dnl # device. Remove the loopback address restriction listen to the network. dnl # dnl DAEMON_OPTIONS(`port=smtp,Addr= 1, Name=MTA-v6, Family=inet6 )dnl dnl # dnl # enable both ipv6 and ipv4 in sendmail dnl # dnl DAEMON_OPTIONS(`Name=MTA-v4, Family=inet, Name=MTA-v6, Family=inet6 ) dnl # dnl # We strongly recommend not accepting unresolvable domains if you want to dnl # protect yourself from spam. However, the laptop and users on computers dnl # that do not have 24x7 DNS do need this. dnl # FEATURE(`accept_unresolvable_domains )dnl dnl # dnl FEATURE(`relay_based_on_MX )dnl dnl # dnl # Also accept email sent to "localhost.localdomain" as local email. dnl # LOCAL_DOMAIN(`localhost.localdomain )dnl dnl # dnl # The following example makes mail from this host and any additional dnl # specified domains appear to be sent from mydomain.com dnl # dnl MASQUERADE_AS(`mydomain.com )dnl dnl # dnl # masquerade not just the headers, but the envelope as well dnl # dnl FEATURE(masquerade_envelope)dnl dnl # dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well dnl # dnl FEATURE(masquerade_entire_domain)dnl dnl # dnl MASQUERADE_DOMAIN(localhost)dnl dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl dnl MASQUERADE_DOMAIN(mydomain.lan)dnl MAILER(smtp)dnl MAILER(procmail)dnl ================================================================================ 2./etc/mail/sendmail.cf を作成する # m4 /etc/mail/sendmail.mc /etc/mail/sendmail.cf 3./etc/mail/submit.mc を編集する 以下のファイルを編集する。 ※編集する前にsubmit.mcとsubmit.cfのオリジナルをコピーしておくことをお勧めします。 [root@Ee-Cash ~]# cp -p /etc/mail/submit.mc /etc/mail/submit.mc.org [root@Ee-Cash ~]# vi /etc/mail/submit.mc ①25行目あたりに、下記のような「confDIRECT」という記述があると思うので、これを変更します。 (変更前)dnl define(`confDIRECT_SUBMISSION_MODIFIERS ,`C ) ↓ (変更後) define(`confDIRECT_SUBMISSION_MODIFIERS ,`C ) 4./etc/mail/submit.cf を作成する m4コマンドでsubmit.cfを更新する。 [root@Ee-Cash ~]# m4 /etc/mail/submit.mc /etc/mail/submit.cf 5./etc/Hosts ファイル に上記で設定したSMTPサーバー(メールサーバー)を登録する # vi /etc/hosts 例)10.20.xx.xx xx.xx.co.jp hhh 127.0.0.1 localhost.localdomain localhost 6.設定値を反映させるため、SendMailを再起動する # /etc/init.d/sendmail restart
https://w.atwiki.jp/banrui/pages/21.html
mailのセッティング 重要; http //guides.rubyonrails.org/action_mailer_basics.html Gmailの設定: config.action_mailer.delivery_method = smtp 11/04/21 23 31 config.action_mailer.smtp_settings = { address = "smtp.gmail.com", port = 587, domain = domain name , user_name = username , password = password , authentication = plain , enable_starttls_auto = true, } 参考: http //d.hatena.ne.jp/shunsuk/20110110/1294657636 ActionMailer http //d.hatena.ne.jp/willnet/20100429/1272513819 console上でのテスト: RegisterMailer.test_mail("").deliver mailer.rbの中身: class RegisterMailer ActionMailer Base default from = "bando.rui@gmail.com" def register_mail(user) mail( to = "bando.rui@gmail.com", subject = "Welcome to My Info Site") end end
https://w.atwiki.jp/hayao/pages/20.html
CentOS では SMTPサーバー は、デフォルトでは sendmail です。 しかしこの sendmail は設定が難しいので、sendmail互換である Postfix に移行させます。 Maildir 形式が利用しやすいのも、移行の目的の1つです。 Postfix のインストール # yum install postfix sendmail の停止 とりあえず sendmail を停止させておく # service sendmail stop sm-client を停止中 [ OK ] sendmail を停止中 [ OK ] ついでに sendmail の自動起動設定も調べておき、さらに自動起動リストから外す # chkconfig --list sendmail sendmail 0 off 1 off 2 on 3 on 4 on 5 on 6 off # chkconfig --del sendmail main.cf の設定 Postfix では /etc/postfix/main.cf を編集します。 以下はデフォルトに対して編集した箇所です。 myhostname = myhost.mydomain mydomain = mydomain myorigin = $myhostname ・・・ このホストで出されたメールのドメイン部分(@より後ろの部分)。通常は $myhostname inet_interfaces = all ・・・ メールを受け取るネットワークインタフェースのアドレス範囲を指定する。 mydestination = $myhostname, localhost.$mydomain, localhost ・・・ このSMTPサーバーが、最終目的地とみなす範囲。つまりこれ以外は別ホストに転送する。 mynetworks_style = subnet ・・・ 信頼できるSMTPクライアントを指定する。subnnet は自ホストの所属しているサブネットです。 relay_domains = $mydestination ・・・ リレーを許可するドメイン home_mailbox = Maildir/ ・・・ Maildir 形式を利用する sendmail_path = /usr/sbin/sendmail ・・・ sendmail互換プログラムのパス。いろいろな CGI などがこのパスを利用しているので、今までの sendmail と同じにする。あとで /usr/sbin/sendmail.postfix と入れ替える必要がある。これにより、CGI側は修正が不要になる。 /usr/sbin/sendmail の修正 上述の main.cf の設定で行ったように、/usr/sbin/sendmail が Postfix の sendmail互換プログラムになるように修正が必要です。 # mv /usr/sbin/sendmail /usr/sbin/sendmail.old ・・・ sendmail.old と名前を変更する。 # ln -s /usr/sbin/sendmail.postfix /usr/sbin/sendmail ・・・ シンボリックリンクを張る 自動起動の設定 # chkconfig --add postfix ・・・ 自動起動に追加する # chkconfig --list postfix ・・・ 自動起動のランレベルを確認する postfix 0 off 1 off 2 on 3 on 4 on 5 on 6 off # service postfix start ・・・ サービスを開始する postfix を起動中 [ OK ]
https://w.atwiki.jp/godmail/pages/12.html
god mail god communication
https://w.atwiki.jp/lud-p/pages/29.html
jail fulltree 10.2-Release jail fulltree 10.2-Release mainte 用 jail fulltree の構築 jail環境構築 jail fulltree の初期設定 自動起動設定 jail fulltree の整備 portsnap で ports の更新 portsの自動メンテナンス ports メンテナンス結果のメール送信 pkg_replace のインストール portconf のインストール ports の脆弱性チェック設定 ports の脆弱性チェック結果のメール送信 sendmail の設定 freebsd-update 自動更新設定 資料 アーカイブ 関連ページ FreeBSD 10.2-Releaseにjail fulltreeを導入した時の備忘的まとめです 今後、このfulltreeを使用して minitree を作成していきます このリリースから jail.conf を使用します jail fulltree 10.0-Releaseでできなかった bsdinstall jail で導入しています mainte 用 jail fulltree の構築 HOST環境での作業 jail環境構築 bsdinstall jailを使用して jail環境を構築します jail fulltree 用ディレクトリを作成しますzfs でディレクトリを切り分けます # mkdir /jail # mkdir /jail/mainte # zfs create -o mountpoint=/jail/mainte tank0/jail/mainte102 bsdinstallを使用して インストールします # bsdinstall jail /jail/mainte Mirror Selection 一番近い "日本" のミラーサーバを選択 Distribusion Select baseのみインストールするため すべてのチェックを外します ↑ jail fulltree の初期設定 設定のため、起動させます # mount -t devfs devfs /jail/mainte/dev # jail /jail/mainte test.localdomain 192.168.1.102 /bin/tcsh JAIL環境での作業 起動時の警告を抑制するため、空の/etc/fstabファイルを作成します # touch /etc/fstab sendmailの警告を抑制するため/etc/mail/aliases.dbを生成します # newaliases rc.confの設定をします # vi /etc/rc.conf network_interface="" rpcbind_enable="NO" inet_enable="NO" syslogd_flags="-ss" sshd_enable="NO" sendmail_enable="NO" sendmail_submit_enable="NO" sendmail_outbound_enable="NO" sendmail_msp_queue_enable="NO" resolv.conf の設定をします # echo nameserver 192.168.1.1 /etc/resolv.conf root のログインシェルを変更しますjexec を使用して jail fulltree に入るので ログインシェルを無しにします # vipw root * 0 0 0 0 Charlie /root /usr/sbin/nologin toor * 0 0 0 0 Bourne-again Superuser /root /usr/sbin/nologin 上記2行のみ変更 タイムゾーンを変更します # cp -p /usr/share/zoneinfo/Asia/Tokyo /etc/localtime crontab を編集します # vi /etc/crontab # SHELL=/bin/sh PATH=/etc /bin /sbin /usr/bin /usr/sbin HOME=/var/log # #minute hour mday month wday who command 1 0 * * * root newsyslog その他は削除 newsyslog を編集します # vi /etc/newsyslog.conf # logfilename [owner group] mode count size when flags [/pid_file][sig_num] /var/log/all.log 600 7 * @T00 - その他は削除 ログを設定します # echo *.* /var/log/all.log /etc/syslog.conf # touch /var/log/all.log # chmod 600 /var/log/all.log /etc/hosts.allowをすべて拒否に変更します # echo ALL ALL deny /etc/hosts.allow /etc/make.confを設定しますX等のグラフィック関係、IPV6など使用しないものを無効にし、マルチバイト関数はないとハマルとのことSUPHOST と MASTER_SITE_OVERRIDE は、CVSup サイト一覧 と ftp サイト一覧 から日本のサイトを選択WRKDIRPREFIX と DISTDIR を設定最適化のためCPUTYPE CFLAGS COPTFLAGS を設定/usr/share/example/etc/make.confと/usr/share/mk/bas.cpu.mkを参考にCPUTYPEをslmに設定しました # vi /etc/make.conf WITHOUT_X11=yes WITHOUT_GUI=yes NO_X=true WITHOUT_IPV6=yes WITH_MBSTRING=yes SUPHOST=cvsup3.jp.freebsd.org MASTER_SITE_OVERRIDE=ftp //ftp3.jp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR} WRKDIRPREFIX=/tmp DISTDIR=/tmp/distfiles CPUTYPE=slm CFLAGS= -O2 -fno-strict-aliasing -pipe COPTFLAGS= -O2 -fno-strict-aliasing -pipe Jail環境での作業を終了します # exit ↑ HOST環境での作業 自動起動設定 devfs.rules の設定 # vi /etc/devfs.rules [devfsrules_jail_inet=250] add include $devfsrules_hide_all add path null unhide [devfsrules_jail_vnet=249] add include $devfsrules_hide_all add path null unhide add path mem unhide add path kmem unhide jail.conf の設定 # vi /etc/jail.conf /* 共通項目 */ path = "/jail/$name"; $hostname = "localhost.com"; host.hostname = "${name}.${hostname}"; $int_if = "re0"; $bridge_if = "bridge0"; $defaultroute = "192.168.1.251"; $devfs_jail = "4" $devfs_jail_inet = "250" $devfs_jail_vnet = "249" mount.nodevfs; devfs_ruleset = $devfs_jail; securelevel = "0"; allow.raw_sockets = "0"; allow.sysvipc = "0"; vnet.interface = "epair${jid}b"; exec.prestart = "ifconfig epair${jid} create up /dev/null 2 1"; exec.prestart += "ifconfig ${bridge_if} addm epair${jid}a /dev/null 2 1"; exec.start = "/sbin/ifconfig epair${jid}b up ${ip4addr}"; exec.start += "/sbin/route add default ${defaultroute}"; exec.poststart = ""; exec.prestop = ""; exec.stop = ""; exec.poststop = "ifconfig epair${jid}a destroy /dev/null 2 1"; /* 共通項目 */ mainte { mount.devfs; devfs_ruleset = $devfs_jail; allow.raw_sockets = "1"; //allow.sysvipc = "1"; jid = "250"; $ip4addr = "192.168.1.250"; /* inet */ ip4.addr = ${ip4addr}; interface = ""; exec.prestart = ""; exec.start = ""; exec.poststart = ""; exec.prestop = ""; exec.stop = ""; exec.poststop = ""; vnet.interface = ""; /* inet */ /* vnet * vnet; /* vnet */ exec.prestart += "/bin/mkdir -p /tmp/${name}/tmp/distfiles"; exec.prestart += "/sbin/mount -t nullfs /tmp/${name}/tmp ${path}/tmp"; exec.start += "/bin/sh /etc/rc"; exec.poststart += ""; exec.prestop += ""; exec.stop += "/bin/sh /etc/rc.shutdown"; exec.poststop += "rm -rf /tmp/${name}"; exec.poststop += "/sbin/umount ${path}/tmp"; /* persist */ //persist; /* depend */ //depend } rc.conf の設定rc.conf に jail の設定を追加します # vi /etc/rc.conf # jail jail_enable="YES" jail_list="mainte" 起動・停止 /usr/sbin/service jail start mainte /usr/sbin/service jail stop mainte ↑ jail fulltree の整備 maintenance 用 jail fulltree を起動します # service jail start mainte # jexec mainte /bin/tcsh portsnap で ports の更新 JAIL環境での作業 portsnap を起動して ports の更新をします初回 # portsnap fetch portsnap extract portsnap update 2回目以降 # portsnap fetch portsnap update ↑ portsの自動メンテナンス portsnap fetch の代わりに portsnap cron を使ったスクリプトを記述します portsnap の実行ログを保存します 後で、ログローテーションの対象にするので、ひたすら追記書きさせます portsnap を cron で流して ports の自動更新をします。 portsnap の自動更新スクリプト # mkdir /root/update # cd /root/update # vi ports_update_cron.sh #!/bin/sh LogFile="/var/log/ports_update.log" echo "### `date` ###" $LogFile /usr/sbin/portsnap cron $LogFile 2 1 /usr/sbin/portsnap update $LogFile 2 1 echo "### `date` ###" $LogFile portsnap の手動更新スクリプト # vi port_update.sh #!/bin/sh /usr/sbin/portsnap fetch /usr/sbin/portsnap update 実行権の付与 # chmod u+x ports_update.sh ports_update_cron.sh crontab の設定適当な頻度で ports の自動更新が走るように設定を追記します vi /etc/crontab # portsnap ports_update 1 9 * * 1,4 root /root/update/ports_update_cron.sh /dev/null 2 1 ログローテーション設定portsnap のログローテーション設定を 追記します vi /etc/newsyslog.conf # logfilename [owner group] mode count size when flags [/pid_file][sig_num] /var/log/all.log 600 7 * @T00 - /var/log/ports_update.log 600 7 1 * N ↑ ports メンテナンス結果のメール送信 ports 更新の有無を簡単に知る為に、定期的に portversion のコマンド結果をメールで送信します mail コマンドを使ってメールを送信するスクリプト # vi portvermail.sh #!/bin/sh #------------------------------------------ MailTO="root" MilTmp=/tmp/pkgversion.txt MilHed="mainte pkg version list" #------------------------------------------ echo $MilHed $MilTmp echo "" $MilTmp /usr/sbin/pkg_version -v $MilTmp cat $MilTmp | /usr/bin/mail -s "$MilHed" $MailTO 実行権の付与 chmod u+x portvermail.sh ports_update_cron.sh へ追加 echo /root/update/portvermail.sh ports_update_cron.sh ↑ pkg_replace のインストール ports の更新やインストールに pkg_replace を入れます ports からインストールとハッシュテーブルの再構築 # cd /usr/ports/ports-mgmt/pkg_replace # make install clean # rehash ↑ portconf のインストール portをインストールする際の設定をmake install でも同じくするためのツールだそうです pkg_replace コマンドでインストールします。 # pkg_replace -vcCN ports-mgmt/portconf ↑ ports の脆弱性チェック設定 ports ソフトウェアの脆弱性をチェックします 脆弱性のチェック # pkg audit -F ↑ ports の脆弱性チェック結果のメール送信 毎日 pkg audit のチェック結果をメールで報告させます mail コマンドを使ってメールを送信するスクリプトを記述します #cd /root/update #vi pkg_auditmail.sh #!/bin/sh RanDOM=`jot -r 1 1 1800` /bin/sleep $RanDOM #------------------------------------------ MailTO="root" MilTmp="/tmp/pkg_audit.txt MilHed="pkg audit report" #------------------------------------------ echo $MilHed $MilTmp echo "" $MilTmp /usr/sbin/pkg audit -F $MilTmp cat $MilTmp | /usr/bin/mail -s "$MilHed" $MailTO 実行権の付与 chmod u+x pkg_auditmail.sh crontab の設定適当な頻度で ports の自動更新が走るように設定を追記します vi /etc/crontab # pkg audit 1 5 * * * root /root/update/pkg_auditmail.sh /dev/null 2 1 ↑ sendmail の設定 結果メールを送信する為に sendmail を起動し、送信後に sendmail を止めるスクリプトを作成します 全拒否の hosts.allow # vi /root/update/hosts.allow_deny ALL ALL deny sendmail許可の hosts.allow # vi /root/update/hosts.allow_mail sendmail localhost allow sendmail 192.168.1.90 allow sendmail .localdomain allow ALL ALL deny sendmail 完全停止用の rc.conf cp /etc/rc.conf rc.conf_none sendmail 起動用の rc.conf現在の /etc/rc.confを流用します # cp /etc/rc.conf rc.conf_mail # sed -i -e "/^sendmail_/d" /root/update/rc.conf_mail # echo sendmail_enable="NO" /root/update/rc.conf_mail メールの転送設定 echo admin@localdomain /root/.forward メール送信シェルスクリプトの作成# vi resend.sh #!/bin/sh cp -p /root/update/rc.conf_mail /etc/rc.conf cp -p /root/update/hosts.allow_mail /etc/hosts.allow sh /etc/rc.sendmail start sleep 6 sh /etc/rc.sendmail stop sleep 4 pkill sendmail cp -p /root/update/hosts.allow_deny /etc/hosts.allow cp -p /root/update/rc.conf_none /etc/rc.conf 実行権付与 # chmod u+x resend.sh portvermail.sh の変更メール送信シェルスクリプトの起動を追記します echo /root/update/resend.sh /root/update/portvermail.sh portauditmail.sh の変更メール送信シェルスクリプトの起動を追記します echo /root/update/resend.sh /root/update/portauditmail.sh ↑ freebsd-update 自動更新設定 freebsd-updateがディレクトリ指定で updateできるようなのでその機能を利用します Jail環境での作業を終了します # exit HOST環境での作業 freebsd-updateスクリプトの設定freebsd-update fetch の代わりに freebsd-update cron という cron 動作用のコマンドを使用しますまた HOST は cron(fetch) のみ jail は install まで行います # mkdir /root/update # cd /root/update # vi freebsd-update_cron.sh #!/bin/sh ### HOST用 /usr/sbin/freebsd-update cron #/usr/sbin/freebsd-update install ### mainte jail用 /usr/sbin/freebsd-update -b /jail/mainte -d /jail/mainte/var/db/freebsd-update fetch /usr/sbin/freebsd-update -b /jail/mainte -d /jail/mainte/var/db/freebsd-update install 実行権付与 chmod u+x freebsd-update_cron.sh crontab の設定適当な頻度で freebsd-update が起動するように追記します # vi /etc/crontab # freebsd-update 0 6 * * 2,4,6 root /root/freebsd-update_cron.sh /var/log/freebsd-update.log 2 1 freebsd-update の結果をメール送信freebsd-update cron が実行されて何らかのアップデートがあった場合、ローカルの root 宛にメールを出してくれる機能が組み込まれているので、特別な作業はありません メールの転送設定ローカルのroot宛にメールを出してくれるので、普段使うアドレスへ転送する設定をします echo admin@localdomain /root/.forward 資料 アーカイブ ↑ 関連ページ ↑ 名前 コメント
https://w.atwiki.jp/skill2linux/pages/35.html
ネットワークのイメージ こんな感じを想定しませう。 BIND のインストール とりあえず、SMTP による自サーバへの配信は、Sendmail 設定系で出来るようになりましたが、 自サーバ以外へのメール配送が出来ない状態です。 ここでは、DNS のサーバの BIND を使用して、メールのリレー先を指定してあげる設定をしましょう。 とりあえず、BIND をインストールします。 yum install -y bind これで、BIND がインストールされました。 設定ファイルの編集 とりあえず、設定ファイルを作ります。 適当に、自分をマスタとして、zone を指定するでごわす。 問い合わせに制限を掛けているんで、面倒なので解除します。 当然、外部に公開する場合は、色々と考慮しないと駄目ですょ。 // // named.conf // // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS // server as a caching only nameserver (as a localhost DNS resolver only). // // See /usr/share/doc/bind*/sample/ for example named configuration files. // options { // listen-on port 53 { 127.0.0.1; }; // listen-on-v6 port 53 { 1; }; directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; memstatistics-file "/var/named/data/named_mem_stats.txt"; // allow-query { localhost; }; recursion yes; dnssec-enable yes; dnssec-validation yes; dnssec-lookaside auto; /* Path to ISC DLV key */ bindkeys-file "/etc/named.iscdlv.key"; managed-keys-directory "/var/named/dynamic"; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; zone "." IN { type hint; file "named.ca"; }; include "/etc/named.rfc1912.zones"; include "/etc/named.root.key"; acl localdomain { 192.168.1.0/24; 127.0.0.1; }; zone "example.localdomain" { type master; file "example.zone"; }; zone "11.168.192.in-addr.arpa" { type master; file "example.rev"; }; zone ファイルを置く zone ファイルを置きます。 とりあえず、逆引き、正引き両方作っときます。 example.zone(正引き用) $TTL 86400 @ IN SOA dns.example.localdomain. root.example.localdomain. ( 2002122001 ; serial 3600 ; refresh 1hr 900 ; retry 15min 604800 ; expire 1w 86400 ; min 24hr ) IN NS dns.example.localdomain. @ IN A 192.168.11.100 @ IN MX 10 sendmail1 dns IN A 192.168.11.100 sendmail1 IN A 192.168.11.101 sendmail2 IN A 192.168.11.102 sendmail2 IN MX 10 sendmail2 sendmail-relay IN A 192.168.11.103 example.rev(逆引き用) $TTL 86400 @ IN SOA dns.example.localdomain. root.example.localdomain. ( 2002122001 ; Serial 3600 ; Refresh 900 ; Retry 604800 ; Expire 3600 ) ; Minimum IN NS dns.example.localdomain. 100 IN PTR dns.example.localdomain. 101 IN PTR sendmail1.example.localdomain. 102 IN PTR sendamil2.example.localdomain. 103 IN PTR sendmail-relay.example.localdomain. メール設定 とりあえず、これで DNS の設定は行けるはず。 行けないのかな…。試してないけど。
https://w.atwiki.jp/centos-home/pages/32.html
下例の前提事項 メールサーバーにするホスト名はqueen.homeとする。 家庭内のサブネットは192.168.1.0/24で、ドメインはhomeとする。 メールの保存はmbox形式ではなく、Maildir形式を採用する。 sendmailの停止とpostfixのインストール # /etc/rc.d/init.d/sendmail stop # chkconfig sendmail off # yum -y install postfix 送信メールサーバを切り替える # alternatives --config mta ↑切替プログラムがあり使用する mta を指定します。 選択 コマンド ----------------------------------------------- *+ 1 /usr/sbin/sendmail.sendmail 2 /usr/sbin/sendmail.postfix Enter を押して現在の選択 [+] を保持するか、選択番号を入力します 2 ↓ 選択 コマンド ----------------------------------------------- * 1 /usr/sbin/sendmail.sendmail + 2 /usr/sbin/sendmail.postfix 家庭内のPCからインターネットへメール送信できるようにする(/etc/postfix/main.cfの編集) 変更点1 #myhostname = host.domain.tld ↓ myhostname = queen.home 変更点2 #mydomainname = domain.tld ↓ #mydomainname = home 変更点3 #myorigin = $mydomain ↓ myorigin = $mydomain 変更点4(デフォルトではローカル発信されたメールのみ送信可能だが、外部(別ホスト)からのメールもを受け取れるように設定をallへ変更。) #inet_interfaces = all ↓ inet_interfaces = all inet_interfaces = localhost ↓ #inet_interfaces = localhost 変更点5(メールサーバなので$mydomain宛のメールも最終目的地として受け取る必要がある。) #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain ↓ mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain 変更点6(メールリレーを行う(信頼する)送信元をサブネットで指定。つまり家庭内とローカルのみ。) #mynetworks_style = subnet ↓ mynetworks_style = subnet 変更点7(内部ネットワークアドレスとローカルホストアドレスを指定。) #mynetworks = 168.100.189.0/28, 127.0.0.0/8 ↓ mynetworks = 192.168.1.0/24, 127.0.0.0/8 変更点8(外部から入ってくるメールでリレーを行う範囲を指定。) #relay_domains = $mydestination ↓ relay_domains = $mydestination 変更点9(MairDir方式を取る) #home_mailbox = Maildir/ ↓ home_mailbox = Maildir/ 変更点10(メールを保存するディレクトリ指定する) #mail_spool_directory = /var/spool/mail ↓ mail_spool_directory = /var/spool/mail Maildir形式のディレクトリ作成 各ユーザのホームディレクトリに以下のようにMaildir形式のディレクトリを作成する。 $ mkdir -m 700 ~/Maildir $ mkdir -m 700 ~/Maildir/new 新着メールの保存先 $ mkdir -m 700 ~/Maildir/tmp 一時ファイルの保存先 $ mkdir -m 700 ~/Maildir/cur 既読メールの保存先 ※新規ユーザを追加したときに自動的に作成されるように"/etc/skel/"にも同様にディレクトリを 同様にディレクトリを作成しておくと便利です。 設定の確認点(追加) alias_maps = hash /etc/aliases alias_database = hash /etc/aliases SMTP認証(587) OB25 対応 sasl_passwd作成 # vim /etc/postfix/sasl_passwd ファイルの内容は [送信するSMTPサーバ(例:smtp.gmail.com)] 587 [メールアドレス(例:hogehoge@gmail.com) [パスワード] ※GMailの場合はメールアドレス全てだが、他のプロバイダではアカウント名だけでよい場合もある sasl_passwdのdb化 # postmap /etc/postfix/sasl_passwd /etc/postfix/main.cfの編集2 追加点1 relayhost = [送信するSMTPサーバ(例:smtp.gmail.com)] 587 追加点2(送信するSMTPサーバから要求されいてうるAUTHがLOGIN PLAINである場合の例) ###sasl setting smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash /etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_sasl_tls_security_options = noanonymous smtp_sasl_mechanism_filter = plain ###tls setting smtp_use_tls = yes cyrus-sasl-plainパッケージのインストール(まだインストールされていなければ) # yum install -y cyrus-sasl-plain postfixの再起動 # /etc/rc.d/init.d/postfix reload 送信メールサーバーの起動と自動起動の設定 # /etc/rc.d/init.d/postfix start # chkconfig postfix on sendmailの削除 # yum remove sendmail 参考リンク あにょの自宅サーバー構築メモ(Fedora) Postfixで、GMAIL経由でメールを送る(OP25B対策) Postfixのmain.cfの注釈日本語訳 Postfixの ~/.forward の書き方 このページを編集
https://w.atwiki.jp/codenamesting/pages/13.html
©2009 CODE NAME STING by YNK JAPAN Inc,. All Rights Reserved.
https://w.atwiki.jp/granblue/pages/17.html
相手メールサーバーに迷惑メールサーバーと思われないようにする これらの設定がないとYahoo!メールの場合、メールのヘッダに迷惑メールっぽいよ?っていう↓のヘッダが差し込まれて デフォルトで迷惑メールフォルダに突っ込まれてしまうようだ X-YahooFilteredBulk xxx.xxx.xxx.xxx (IPアドレス) 個別に迷惑マークを解除すると次回から迷惑メールフォルダには入らなくなるが、 迷惑メールヘッダは差し込まれたまま ちなみにこの指定の解除は、以下の設定をしただけでそのうち直るかもしれないが、 カスタマーサポートに所定の様式を添えて問い合わせると こっちの設定がちゃんとしていれば、案外すぐに確認してくれて解除してくれる 逆引き設定をする IPアドレスからドメイン名を引けるようにする この設定はレンタルサーバー会社などネットワーク管理者に申請する感じ、正引きの場合と違う ちなみに、メールヘッダに記載されてる情報はメールアドレスのドメインじゃなくて メールサーバーのホスト名っぽい だから、逆引きの設定もドメイン名よりホスト名にした方がいいのかな?(未確認) SPFレコード 平たく言うとDNSレコードのtxtと言う種類のフィールドに、このドメインのメールはこのIPアドレスからしか 送信しませんという宣言みたいな感じのようだ 設定例 v=spf1 +mx -all これは、DNSレコードのうちmxレコードにあるIPアドレスから送信を許可し、それ以外から全部拒否 みたいな感じらしい 他にもIPアドレスで指定したりできる 設定前のメールヘッダ Received-SPF neutral (google.com 123.456.789.012 is neither permitted nor denied by best guess record for domain of info@example.com) client-ip=123.456.789.012; Authentication-Results mx.google.com; spf=neutral (google.com 123.456.789.012 is neither permitted nor denied by best guess record for domain of info@example.com) smtp.mail=info@example.com 設定後のメールヘッダ Received-SPF pass (google.com domain of info@example.com designates 123.456.789.012 as permitted sender) client-ip=123.456.789.012; Authentication-Results mx.google.com; spf=pass (google.com domain of info@example.com designates 123.456.789.012 as permitted sender) smtp.mail=info@example.com ちなみに、これだけやってもAOLだけは受信できなかった 詳しい設定はこちらの記事を参照 http //www.atmarkit.co.jp/fsecurity/special/82senderid/sender103.html サイト上からsendmailでメールを送信する時のワーニング サイト上からPHPの機能を使ってメールを送信すると以下のようなヘッダがメールに自動的に差し込まれていた X-Authentication-Warning example.co.jp apache set sender to info@example.com using -f どうやら、メール送信時にApacheが親切にも送信元を書き換えているので注意してくださいみたいな ワーニングを付けてくれているらしいが、このせいで受信できなかったり迷惑メールにと判定されたりすることもあるらしい /etc/mail/trusted-users で、このファイルにapacheと追記するだけで解決した なお、このサーバーはsendmailを使っていたのでこうなったが、postfixだとどうなるのかは不明 Courier-IMAPの起動と停止 メール配信システム。ソースから自力でインストールしてたりすると、serviceに登録されないのか serviceコマンドから認識できなかったので。 Solaris# /usr/lib/courier-imap/libexec/imapd.rc start Solaris# /usr/lib/courier-imap/libexec/pop3d.rc start /var/log/maillog に下のよくわからないローカルホストからのアクセスログがでまくりだった。 Postfixだけを停止させていたので、Courier-IMAPがローカルのPostfixを探し続けているんじゃないだろうか。 Dec 16 12 02 18 localhost pop3d Connection, ip=[ ffff 127.0.0.1] Dec 16 12 02 18 localhost pop3d LOGOUT, ip=[ ffff 127.0.0.1] Dec 16 12 02 18 localhost pop3d Disconnected, ip=[ ffff 127.0.0.1] Dec 16 12 03 16 localhost imapd Connection, ip=[ ffff 127.0.0.1] Dec 16 12 03 16 localhost imapd LOGOUT, ip=[ ffff 127.0.0.1], rcvd=10, sent=307 OP25B 対策 port25でメールが送れなくなるやつ。普通の設定のほかに /etc/postfix/main.cf のmynetworksのところにこんな感じで、いちいちIPアドレスかネットワークアドレスを登録する必要がある模様。 mynetworks = 127.0.0.0/8, 122.xxx.xxx.xxx, 222.xxx.xxx.xxx どういうことなのかよくわからないが、他に方法があるのか不明。 MTAの変更 alternatives --config mta SquirrelMailのEmpty Trashプラグイン ダウンロードして展開後、設定ツールで登録するだけでなく、プラグインディレクトリ内の 設定ファイルをサンプルから作らないとダメらしい。 cp empty_trash/config.php.sample empty_trash/config.php コマンドラインからメール送信 そのサーバーからメールが送れるかテストするのに、いちいちプログラムを作ったりするのが面倒なので コマンドから送信テストできる mail メールアドレス 件名を入れてリターン、本文を入れて終わりは「.(ピリオド)」を入れてリターンで本文終了 Ccを入れてもいれなくてもOKでリターンで送信できている模様 送信専用sendmailの設定 ECサイトなどで、申込完了メールを送信する、送信専用としてsendmailを動かす場合 デーモンとして sendmail を動かす必要はないんだって、知らんかった。 インストールだけで動くものと思ってたが、動かなかったことがあったのでメモ。 設定ファイルも、デーモン用とコマンドから送信する時に使う設定ファイルが違っていて、 sendmail.cf は サーバ用の設定ファイルで mail コマンドが使用するのは submit.cf とのこと。 .cfが設定ファイルだが、.mcファイルを編集してそれから生成するものらしい。 # vi /etc/mail/submit.mc 次の設定を変更 FEATURE(`msp , `[127.0.0.1] )dnl 外部のメールサーバが mail.example.com のとき次のように記述。 "dnl" は、コメントアウト。 dnl FEATURE(`msp , `[127.0.0.1] )dnl FEATURE(`msp , `mail.example.com )dnl ついでに次のように記述してホスト名を設定できます。(らしい) 送信メールが xxxx @example.com の様になる。 define(`confDOMAIN_NAME , `example.com )dnl 編集が終わったら、次のコマンドで submit.mc から submit.cf を作成 # m4 /etc/mail/submit.mc /etc/mail/submit.cf sendmail-cf パッケージが入っていないと m4 コマンドがないので インストールする必要がある # yum install sendmail-cf 転載元 http //www.odin.hyork.net/write/write0068.html